"use client"
import { useAppContext } from "@/components/AppContext"
import Button from "@/components/common/Button"
import { ActionType } from "@/reducers/AppReducer"
import { LuPanelLeft } from "react-icons/lu"

export default function Main() {
  const { state: { displayNavigation }, dispatch } = useAppContext()
  return <Button className={`${displayNavigation ? 'hidden' : ''}  fixed left-2 top-2 `} icon={LuPanelLeft} variant="default" onClick={() => {
    // 更新函数传递一个匿名函数并接受一个参数
    dispatch({ type: ActionType.UPDATE, field: "displayNavigation", value: true })

  }} />
}